﻿/* 
 * author: www.cnblogs.com/luminji
 * date  : 2011/12/28
 */
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Luminji.Exam.Infrastructure.Repositories.Subjects;
using Luminji.Exam.Model.Subjects;
using Luminji.ExamWeb.Helpers;
using Luminji.ExamWeb.Helpers.Tools;
using Luminji.Infrastructure.UnitOfWork;
using Luminji.Exam.Model;
using Microsoft.Practices.Unity;
using Microsoft.Practices.Unity.Configuration;
using Luminji.Core.Web.Cookie;
using Luminji.Core.Web;
using Luminji.ExamWeb.Models;
using Luminji.Core.Enterprise.RBAC;
using Luminji.Exam.Model.Users;
using Luminji.Exam.Application;

namespace Luminji.ExamWeb.Controllers
{

    public class HomeController : BaseExamControl, IAuthority
    {
        private SubjectService _subjectService;

        public HomeController()
        {
            IUnitOfWork uw = new UnitOfWork();
            _subjectService = new SubjectService(new SubjectRepository(uw),uw );
        }
        
        //[Task(ApplicationTask.ViewHomeIndex)]
        //public virtual ActionResult Index()
        public ActionResult Index()
        {
            var subjects = _subjectService.FindAllIntoThree();
            ViewBag.SubjectView = SubjectTool.GetSubjectHtmlView(subjects);
            return View();
        }

        public ActionResult About()
        {
            return View();
        }

        public ActionResult IndexFooter()
        {
            return View();
        }
    }
}
